<template>
  <div class="document-manage">
    <!-- 上面的查询框 -->
    <div class="query-form">
      <el-form :inline="true" :model="queryForm" ref="form">
        <el-form-item label="项目名称" prop="itemName">
          <el-input v-model="queryForm.itemName" placeholder="请输入项目名称" />
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="handleQuery">查询</el-button>
          <el-button @click="handleReset('form')">重置</el-button>
        </el-form-item>
      </el-form>
      <div class="action">
        <el-button type="primary" @click="handleCreateDocument"
          >新增文档</el-button
        >
      </div>
    </div>
    <!-- 下面的表格 -->
    <div class="base-table">
      <!-- 表单 -->
      <el-table :data="itemList" :stripe="true" :border="true">
        <el-table-column label="项目名称" prop="itemName" />
        <el-table-column label="项目负责人" prop="classify" />
        <el-table-column label="当前项目执行人" prop="classify" />
        <el-table-column label="项目进度" prop="classify" />
        <el-table-column label="项目截止时间" prop="classify" />
        <!-- 操作 -->
        <el-table-column label="操作" width="170">
          <template #default="scope">
            <el-button size="mini" type="primary" @click="handleEdit(scope.row)"
              >编辑</el-button
            >
            <el-button
              type="danger"
              size="mini"
              @click="handleDel(scope.row.id)"
              >删除</el-button
            >
          </template>
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>

<script>
export default {
  name: 'Document',
  data() {
    return {
      queryForm: {},
      itemList: []
    }
  },
  methods: {
    // 项目检索
    handleQuery() {

    },
    // 重置查询表单
    handleReset(form) {
      this.$refs[form].resetFields()
    },
    handleCreateDocument() {
      this.$router.push({
        path: `/work/compile/111`
      })
    }
  }
}
</script>

<style lang="scss">
.query-form {
  display: flex;
  justify-content: space-between;
}
</style>